package com.heima.article.fegin;

import com.heima.article.service.ApArticleService;
import com.heima.clients.article.IArticleClient;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xiaquanen
 * @version 1.0
 * @project heima-leadnews
 * @date 2024/7/23 16:31:30
 */
@RestController
public class ArticleFeign implements IArticleClient {

    @Autowired
    private ApArticleService apArticleService;

    /**
     * 发布或者更新文章
     *
     * @param articleDto
     * @return
     */
    @PostMapping("/api/v1/article/sync")
    @Override
    public ResponseResult syncArticle(ArticleDto articleDto) {
       return apArticleService.syncArticle(articleDto);
    }
}
